
from xbee import XBee
import serial

Address = ['\x02' ,'\x03']


class Query:


	def __init__(self, PORT = '/dev/ttyUSB0', BAUD_RATE = 9600):
		try:
			ser = serial.Serial(PORT,BAUD_RATE)
			xbee = XBee(ser)
			print("Initialization has been completed")
		
		except SerialException:
			print("There was an error in your port, please enter a new one")



	def addressBook(self):	#Prints out the current addresses
		print(Address)


	def addAddress(newAddress):
		Address.append(newAddress)

	def rmAddress(self):
		

	def pollXbee(Address):
		for i in Address:
			xbee.tx(dest_addr= Address[i], data= '\x00\x00\x00\x00')
			response = xbee.wait_read_frame()
			print response['rf_data']


	def pollAll(self):

